using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.IO;

namespace MaskData
{
	public class ImageElementType : ElementType
	{
		public ImageElementType(String fieldName, String fieldCaption, bool isKey, bool display, Int32 order)
			: base(fieldName, fieldCaption, isKey, display, order)
		{ }
		public override Type GetColumn()
		{
			return typeof(byte[]);
		}
		public override MaskElement CreateMaskElement(Object value)
		{
			if (value is System.DBNull)
				return new ImageMaskElement(this, null);
			Debug.Assert(value.GetType() == typeof(byte[]));
			MemoryStream stream = new MemoryStream((byte[])value);
			return new ImageMaskElement(this, stream);
		}
	}
}
